<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>登录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <style>
        div {
            text-align: end;
        }
        a {
            margin-left: 10px;
            margin-right: 20px;
        }
        .box {
            width: 200px;
            display:block;
            text-align: center;
            margin: 100px auto 0;
        }
        input{
            margin: 5px 0px;
        }
        button{
            display: inline-block;
            margin: 5px 10px;
        }
    </style>
</head>
<body>
<div>
    <span>欢迎，</span>
    <span th:text="${session.user.name}">User Name</span>
    <a href="/logout">退出</a>
</div>
<div class="box">

<p>
    添加活动
</p>
<form action="#" th:action="@{/activity/add}" method="post">
    <input type="text" name="actid" placeholder="活动id" />
    <input type="text" name="name" placeholder="活动名称" />
    <button type="submit">添加</button>
    <button id="back" type="button">返回</button>
</form>
</div>
<script>
    document.getElementById('back').addEventListener('click', function() {
        window.location.href =  "/activity";
    });
</script>
<script th:inline="javascript">
    var msg = [[${msg}]];
    if (msg) {
        alert(msg);
    }
</script>
</body>

</html>